package com.syh.jn.scm.service.api.support.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2019/1/20.
 */
public interface HistoryEnums {

    @Getter
    @AllArgsConstructor
    enum Type{
        SALE(new Short("0"),"销售订单"),
        SALE_RETURN(new Short("1"),"销售退货订单"),
        PURCHASE(new Short("2"),"采购订单"),
        PURCHASE_RETURN(new Short("3"),"采购退货订单");

        private Short status;
        private String name;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static Type valueOf(Short status) {
            switch (status) {
                case 0:
                    return SALE;
                case 1:
                    return SALE_RETURN;
                case 2:
                    return PURCHASE;
                case 3:
                    return PURCHASE_RETURN;
            }
            return null;
        }
    }

}
